package cn.gjxblog.validation.spring.demo2;


import org.springframework.stereotype.Service;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

@Service
public class HelloServiceImpl implements HelloService {
    @Override
    public Object hello(Integer id,  String name) {
        return null;
    }

    /**
     * 注意这条 子类和接口的返回值校验不一样

     */
    @Override
    public @NotNull String hello2(@NotNull @Min(10) Integer id, @NotNull String name) {
        return null;
    }

    @Override
    public void savePerson(Person person) {
        System.out.println("保存Person");
    }

    @Override
    public void savePerson3(@Valid Person person) {

    }

    @Override
    public void savePerson2( @Valid Person person, @NotNull  Person person2) {
        System.out.println("保存Person2");

    }
}
